package cn.itcast.hotel.controller;

import cn.itcast.hotel.dto.RequestParams;
import cn.itcast.hotel.service.IHotelService;
import cn.itcast.hotel.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

/**
 * @Description HotelController
 * @Author junjie Wu 吴俊杰
 * @Date 2024-03-22
 */
@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private IHotelService hotelService;
    /**
     * 搜索
     * @param requestParams
     * @return
     */
    @PostMapping("/list")
    public PageResult searchHotel(@RequestBody RequestParams requestParams) throws IOException {
          return  hotelService.search(requestParams);
    }

}
